package etresVivant;

import java.util.ArrayList;
import java.util.Random;

import model.Case;
import typesEnum.Statut;

public class EtreVivant {

	protected Case m_case;
	protected Statut statut;
	protected int ageJour;
	protected float esperance;
	protected float poids;
	
	public EtreVivant() {
		statut = Statut.VIVANT;
		ageJour = 0;
	}

	public Statut getStatut() {
		return statut;
	}

	public float getPoids() {
		return poids;
	}
	
	public void setCase(Case c) {
		m_case = c;
	}
	
	public int getAge(){
		return ageJour;
	}
	
	public Case getCase() {
		return m_case;
	}
	
	/**
	 * augmenter l'age d'un etre vivant.
	 */
	public void vieillir() {
		ageJour++;
	}

	/**
	 * deplace un etre vivant aleatroiement.
	 */
	public void deplacer() {
		ArrayList<Case> casesVoisines = new ArrayList<Case>();
		casesVoisines = this.getCase().casesVoisines();
		Random rd = new Random();
		int num = rd.nextInt(casesVoisines.size());
		this.setCase(casesVoisines.get(num));
	}
}
